NNNNooootttteeee:::: As of IRIX 6.4, _ssss_hhhh is the Korn shell rather than the Bourne shell.
See _bbbb_ssss_hhhh(1) for the Bourne Shell description. See the CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY
IIIISSSSSSSSUUUUEEEESSSS section below for more detail.
This is the internationalized _ssss_hhhh. See the _IIII_NNNN_TTTT_EEEE_RRRR_NNNN_AAAA_TTTT_IIII_OOOO_NNNN_AAAA_LLLL_IIII_ZZZZ_AAAA_TTTT_IIII_OOOO_NNNN section
below for more detail.
_s_h is a command and programming language that executes commands read from
a terminal or a file. /_u_s_r/_l_i_b/_r_s_h is a restricted version of the
standard command interpreter _s_h; it is used to set up login names and
execution environments whose capabilities are more controlled than those
of the standard shell. See IIIInnnnvvvvooooccccaaaattttiiiioooonnnn below for the meaning of arguments
to the shell.
DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss
A _m_e_t_a_c_h_a_r_a_c_t_e_r is one of the following characters:
_;;;; _&&&& _(((( _)))) _|||| _<<<< _>>>> newline space tab
A _b_l_a_n_k is a tab or a space. An _i_d_e_n_t_i_f_i_e_r is a sequence of letters,
digits, or underscores starting with a letter or underscore. Identifiers
are used as names for _f_u_n_c_t_i_o_n_s and _v_a_r_i_a_b_l_e_s. A _w_o_r_d is a sequence of
_c_h_a_r_a_c_t_e_r_s separated by one or more non-quoted _m_e_t_a_c_h_a_r_a_c_t_e_r_s.
A _c_o_m_m_a_n_d is a sequence of characters in the syntax of the shell
language. The shell reads each command and carries out the desired
action either directly or by invoking separate utilities. A special
command is a command that is carried out by the shell without creating a
separate process. Except for documented side effects, most special
commands can be implemented as separate utilities.
CCCCoooommmmmmmmaaaannnnddddssss
A _s_i_m_p_l_e-_c_o_m_m_a_n_d is a sequence of _b_l_a_n_k separated words which may be
preceded by a variable assignment list (see EEEEnnnnvvvviiiirrrroooonnnnmmmmeeeennnntttt below). The
first word specifies the name of the command to be executed. Except as
specified below, the remaining words are passed as arguments to the
invoked command. The command name is passed as argument 0 [see _eeee_xxxx_eeee_cccc(2)].
The _v_a_l_u_e of a simple-command is its exit status if it terminates
normally, or (octal) 200+_s_t_a_t_u_s if it terminates abnormally [see
_ssss_iiii_gggg_nnnn_aaaa_llll(2) for a list of _s_t_a_t_u_s values].
PPPPaaaaggggeeee 1111
sssshhhh((((1111)))) sssshhhh((((1111))))
A _p_i_p_e_l_i_n_e is a sequence of one or more _c_o_m_m_a_n_d_s separated by _||||. The
standard output of each command but the last is connected by a _pppp_iiii_pppp_eeee(2) to
the standard input of the next command. Each command is run as a
separate process; the shell waits for the last command to terminate. The
exit status of a pipeline is the exit status of the last command.
A _l_i_s_t is a sequence of one or more pipelines separated by _;;;;, _&&&&, _&&&&_&&&&, or
_||||_||||, and optionally terminated by _;;;;, _&&&&, or _||||_&&&&. Of these five symbols, _;;;;,
_&&&&, and _||||_&&&& have equal precedence, which is lower than that of _&&&&_&&&& and _||||_||||.
The symbols _&&&&_&&&& and _||||_|||| also have equal precedence. A semicolon (_;;;;) causes
sequential execution of the preceding pipeline; an ampersand (_&&&&) causes
asynchronous execution of the preceding pipeline (that is, the shell does
not wait for that pipeline to finish). The symbol _||||_&&&& causes asynchronous
execution of the preceding command or pipeline with a two-way pipe
established to the parent shell. The standard input and output of the
spawned command can be written to and read from by the parent shell using
the _----_pppp option of the special commands _rrrr_eeee_aaaa_dddd and _pppp_rrrr_iiii_nnnn_tttt described later.
The symbol _&&&&_&&&& (_||||_||||) causes the _l_i_s_t following it to be executed only if
the preceding pipeline returns a zero (nonzero) value. An arbitrary
number of newlines may appear in a _l_i_s_t, instead of a semicolon, to
delimit a command.
A _c_o_m_m_a_n_d is either a simple-command or one of the following. Unless
otherwise stated, the value returned by a command is that of the last
A _p_a_r_a_m_e_t_e_r is an _i_d_e_n_t_i_f_i_e_r, one or more digits, or any of the
characters _****, _@@@@, _####, _????, _----, _$$$$, and _!!!!. A _v_a_r_i_a_b_l_e (a parameter denoted by
an identifier) has a _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. _V_a_r_i_a_b_l_e_s can be
assigned _vvvv_aaaa_llll_uuuu_eeee_ssss and _a_t_t_r_i_b_u_t_e_s by using the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt special command. The
attributes supported by the shell are described later with the _tttt_yyyy_pppp_eeee_ssss_eeee_tttt
special command. Exported parameters pass values and attributes to the
environment.
The shell supports a one-dimensional array facility. An element of an
array variable is referenced by a _s_u_b_s_c_r_i_p_t. A _s_u_b_s_c_r_i_p_t is denoted by a
_[[[[, followed by an _a_r_i_t_h_m_e_t_i_c _e_x_p_r_e_s_s_i_o_n (see AAAArrrriiiitttthhhhmmmmeeeettttiiiicccc EEEEvvvvaaaalllluuuuaaaattttiiiioooonnnn below)
followed by a _]]]]. To assign values to an array, use
Equivalent to _eeee_xxxx_eeee_cccc _////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_nnnn_eeee_wwww_gggg_rrrr_pppp _a_r_g. The _----_llll (ell) or the _----
option change the environment to what would be expected if the user
To retain some backward compatibility to the Bourne shell, certain Korn
shell features are controlled by how the shell is invoked and/or the
current value of the environment variable ______XXXX_PPPP_GGGG.
When the shell is invoked as _""""_ssss_hhhh_"""", the following features are performed
only when the current value of the ______XXXX_PPPP_GGGG variable is equal to 1 (one):
- command substitution of the form "$( command )"
- arithmetic expression of the form "$(( expression ))"
- tilde expansion of pathnames
- parameter _$$$$_0000 within a function call is the name of the invoking shell script
- unsetting variables, not previously set or null, returns 0
When the shell is not invoked as _""""_ssss_hhhh_"""" and the real and effective uid and
gid differ, the uid and gid are set to the effective uid and gid.
PPPPaaaaggggeeee 44441111
sssshhhh((((1111)))) sssshhhh((((1111))))
With all invocations of the shell, when the current value of the ______XXXX_PPPP_GGGG
environment variable is equal to 1 (one), the _----_nnnn option of the builtin
_eeee_cccc_hhhh_oooo command does not suppress the terminating newline and is treated as
part of the output string.
Additional incompatibilities are listed below and can be found in the
Appendix of the _""""_TTTT_hhhh_eeee _KKKK_oooo_rrrr_nnnn_ssss_hhhh_eeee_llll_llll _CCCC_oooo_mmmm_mmmm_aaaa_nnnn_dddd _aaaa_nnnn_dddd _PPPP_rrrr_oooo_gggg_rrrr_aaaa_mmmm_mmmm_iiii_nnnn_gggg _LLLL_aaaa_nnnn_gggg_uuuu_aaaa_gggg_eeee_"""" _((((_BBBB_oooo_llll_ssss_kkkk_yyyy
The shell accepts multibyte input for command line args, file names,
environment variable names and values, variable arrays, function names,
history files and shell scripts. Multibyte sequences accepted for the
_iiii_ssss_pppp_hhhh_oooo_nnnn_oooo_gggg_rrrr_aaaa_mmmm_((((_)))) and _iiii_ssss_iiii_dddd_eeee_oooo_gggg_rrrr_aaaa_mmmm_((((_)))) subroutines are also allowed.
_NNNN_oooo_tttt_eeee_:::: The _eeee_mmmm_aaaa_cccc_ssss line editing feature is currently supported only with the
default _CCCC/_PPPP_OOOO_SSSS_IIII_XXXX locale.
PPPPaaaaggggeeee 44442222
sssshhhh((((1111)))) sssshhhh((((1111))))
_NNNN_oooo_tttt_eeee_:::: Changing the _LLLL_AAAA_NNNN_GGGG value during a shell session can produce
undefined results when accessing e.g. variables created under a different